﻿using OrderManager.Domain.Repositories;

namespace OrderManager.Domain
{
    /// <summary>
    /// Allows to join different business layers (singleton)
    /// </summary>
    public class DomainContext
    {
        /// <summary>
        /// Represents an instance of <see cref="OrderManager.Domain.DomainContext"/> class
        /// </summary>
        private static DomainContext _instance = new DomainContext();

        /// <summary>
        /// Initialize an instance of <see cref="OrderManager.Domain.DomainContext"/> class
        /// </summary>
        private DomainContext()
        {

        }

        /// <summary>
        /// Gets an instance of <see cref="OrderManager.Domain.DomainContext"/> class
        /// </summary>
        public static DomainContext Instance { get { return _instance; } }

        /// <summary>
        /// Represents an instance that inplements <see cref="OrderManager.Domain.Repositories.IRepositoryFactory"/> interface in current context
        /// </summary>
        public IRepositoryFactory RepositoryFactory { get; set; }

    }
}
